<template>
	<div>parent</div>
	<button @click="aaaAdd">aaa++: {{ aaa }}</button>
	<child ref="childRef" :aaa="aaa" @emit_aaa="emit_aaa"></child>
</template>

<script setup lang='ts'>
	import {
		ref,
		onMounted,
		nextTick
	} from "vue";
	import child from "./child.vue";
	let aaa: any = ref(11111)

	// 父组件中修改数据
	let aaaAdd = () => {
		aaa.value++
	}

	// 接收子组件传参
	function emit_aaa(e) {
		aaa.value = e
	}


	// 父组件获取子组件实例
	let childRef = ref < any > (null)
	onMounted(() => {
		console.log('childRef', childRef.value);
	})
</script>

<style lang='scss' scoped>
</style>